from threading import Thread
import time


class MyThread(Thread):
    """继承Thread类自定义线程
    """

    def run(self):
        """重写run方法
        """
        for i in range(3):
            print("%s----run----> %d" % (self.name, i))
            time.sleep(1)
        return super().run()


def main():
    t = MyThread()
    t.setName("t1")
    t.start()


if __name__ == '__main__':
    main()
    